home *** CD-ROM | disk | FTP | other *** search
- Path: ibm1.eng.ohio-state.edu!xiaoyi
- From: xiaoyi@ibm1.eng.ohio-state.edu (Xiaoyi Wu)
- Newsgroups: comp.graphics.algorithms,comp.lang.c,sci.image.processing
- Subject: Re: 2D image rotation problem
- Date: 19 Jan 1996 14:38:14 GMT
- Organization: The Ohio State University
- Message-ID: <4doacm$27s@charm.magnus.acs.ohio-state.edu>
- References: <4de7gt$j0i@charm.magnus.acs.ohio-state.edu> <4dec11$jg5@charm.magnus.acs.ohio-state.edu> <DLAMGr.LEM@wave.scar.utoronto.ca>
- NNTP-Posting-Host: ibm1.eng.ohio-state.edu
-
- Hi Kap, actually after a night's thought about it i figured it is
- impossible to do a rotation without creating holes unless the image is
- infintely large - of course you can kinda fix them by duplicating the
- closest pixels to the pixels that fall out of the source image.
-
- another option which seems to be the way you did it (at least the way i
- interprete your response) is to ignore the pixels that need to be
- reconstructed using non-existent pixels, and end up with a "rotated"
- image that has blank strips in it.
-
- for me, both would work 'cuz the object in my images are in the center so
- i can afford to ignore the edges. but for other applications i guess i
- still need to be educated.
-
- the reverse rotation is just replacing your theta with -theta :) then
- when you do the interpolation you will be working with pixel values you know.
-
- thanks.
-
- Xiaoyi
-
- On Tue, 16 Jan 1996, Kap Shiwram wrote:
- >
- > Hmm, to keep it in the range of the source image, couldn't you use AND
- > with your index? Um, this is how I use to do it - the rotation failed
- > but it was never out of the range of the source file. :) Um, this is
- > assuming you're using powers of 2 for the dimensions of your image of
- > course; if you're not then you might have to suffer a divide (eeek) i.e.
- > use the MOD of your index into the image and the dimensions multiplied.
- >
- > Um, assuming your image dimensions are 32x32,
- >
- > ; calculate the index [si] first
- > and si, (32*32)-1
- > lea si, [image+si]
- > movsb
- >
- > I'm curious though.. could you explain how you did the reverse rotation?
- > I was thinking about this and doing landscapes or flags. It always had
- > holes in it since I was calculating the X and Y values to plot on screen
- > but if I had just done a loop over the X and Y values then this would not
- > have happened - instead, I would have just calculated the index into the
- > image array and covered the entire area. The problem is, I don't know
- > how to get the reverse function. Is it just the inverse?
- >
- >
- >
-
- Xiaoyi
-
- /=======================================================================\
- | Xiaoyi Wu || If you can't convince them, confuse them. |
- | 614-421-0934 (h) || xiaoyi@mozart.bme.ohio-state.edu |
- | 614-292-1555 (o) || http://chopin.bme.ohio-state.edu/~xiaoyi/hi.html |
- \~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
-
-
-
-